<template name="enterprise">
	<view>


		<view :class="'bg-'+$bgColor()">

			<view class="padding flex bg-white">
				<uni-search-bar radius="100" class="flex-treble radius " placeholder="所属工程" @confirm="search" />
			</view>
			<view class="cu-list menu-avatar">
				<view class="cu-item" @click="goToLink(item)" style="height: 160px;" :class="modalName=='move-box-'+ index?'move-cur':''"
				 v-for="(item,index) in data" :key="index" :data-target="'move-box-' + index">
					<view class="content">
						<view class="cu-form-group ">
							<view class="title">第几次:</view>
							<input name="timeName" :value="item.timeName" disabled="disabled"></input>
						</view>
						<view class="cu-form-group ">
							<view class="title">查看时间:</view>
							<input name="viewTime" :value="item.viewTime" disabled="disabled"></input>
							<picker mode="date" :value="item.viewTime" @change="DateChange" disabled="disabled">

							</picker>
						</view>
						<view class="cu-form-group ">
							<view class="title">所属工程:</view>
							<input name="belongProject" :value="item.belongProject" disabled="disabled"></input>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="margin-top">
			<uni-pagination :show-icon="true" :total="total" title="标题文字" @change="changePage" />
		</view>
		<view class="cu-tabbar-height"></view>
	</view>

</template>

<script>
	import uniSearchBar from '@/components/uni-search-bar/uni-search-bar.vue'
	import uniSection from '@/components/uni-section/uni-section.vue'
	import uniPagination from '@/components/uni-pagination/uni-pagination.vue'

	export default {
		data() {
			return {
				data: [],
				searchVal: '',
				district: '',
				index: -1,
				picker: [],
				pageNum: 1,
				pageSize: 10,
				modalName: '',
				total: 50
			}
		},
		mounted() {
			// 初始化加载
			this.req();
			console.log("mounted")
		},
		onLoad() {
			console.log("onLoad")
		},
		onShow() {
			console.log("onShow")
		},
		onBackPress() {
			console.log("onBackPress")
		},
		methods: {
			req() {
				var param = {
					"belongProject": this.searchVal,
					"pageSize": this.pageSize,
					"pageNum": this.pageNum
				}

				this.$httpPost("/system/score/list", param).then(res => {
					this.data = (res.data.rows);
					if (!this.data ||this.data.length == 0) {
						this.data = [{
							operationUnit: ""
						}]
					}

					this.total = res.data.total;
				})

			},
			goToLink(row) {
				uni.navigateTo({
					url: "/pages/project/scoreInfo?scoreId=" + row.scoreId
				});
			},
			search(res) {
				this.searchVal = res.value
				this.req();
			},
			changePage(e) {
				this.pageNum = e.current
				this.req();
			}
		}
	}
</script>

<style>
	.cu-list.menu-avatar>.cu-item .content {
		border: 1px solid #cccccc;
		left: 5px;
		width: 97%;
	}

	.cu-form-group .title {
		min-width: calc(4em + 10px);
		text-align: right;
	}
</style>
